using UnityEngine;
using System.Collections;

public class InteractGravityActivator : InteractObject
{

    override public void Interact(MonoBehaviour sender)
    {
        if (Input.GetKeyDown(interactButton))
        {
            GameObject[] cubes = GameObject.FindGameObjectsWithTag("FlyCube");

            foreach (GameObject cube in cubes)
            {
                cube.transform.rigidbody.useGravity = !cube.transform.rigidbody.useGravity;
            }
        }
    }
}